from PyQt6.QtCore import QTranslator
from PyQt6.QtWidgets import QApplication, QWidget, QLabel
from qfluentwidgets import FluentTranslator

from src.setting.config import cfg

from src.view.MainWindow import MainWindow
import sys

if __name__ == '__main__':
	app = QApplication(sys.argv) #创建应用

	# internationalization
	locale = cfg.get(cfg.language).value
	fluentTranslator = FluentTranslator(locale)
	settingTranslator = QTranslator()
	settingTranslator.load(locale, "settings", ".", "resources/i18n")

	app.installTranslator(fluentTranslator)
	app.installTranslator(settingTranslator)
	MainWindow = MainWindow()
	MainWindow.show()
	sys.exit(app.exec())